<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button onclick="start()">开始</button>
		<button onclick="window.manager.destroy()">销毁</button>
	</body>
</html>
<script type="module">
	import {workerManager} from "./workerManager.js";
	let count=0,manager;
	function start(){
		count++;
		if(count>1000)return;
		setTimeout(async ()=>{
			let res=await manager.abc();
			start();
		},20)
	}
	
	window.start=function(){
		count=0;
		start();
	}
	
	workerManager("./worker.js").then(obj=>{
		manager=obj;
		window.manager=obj;
	});
</script>